Optimal. Leaf size=95 \[ \frac {2 a^2 (A-i B)}{5 c^5 f (i+\tan (e+f x))^5}+\frac {a^2 (i A+3 B)}{4 c^5 f (i+\tan (e+f x))^4}+\frac {i a^2 B}{3 c^5 f (i+\tan (e+f x))^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 95, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} \frac {a^2 (3 B+i A)}{4 c^5 f (\tan (e+f x)+i)^4}+\frac {2 a^2 (A-i B)}{5 c^5 f (\tan (e+f x)+i)^5}+\frac {i a^2 B}{3 c^5 f (\tan (e+f x)+i)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (e+f x))^2 (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^5} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(a+i a x) (A+B x)}{(c-i c x)^6} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (-\frac {2 a (A-i B)}{c^6 (i+x)^6}-\frac {i a (A-3 i B)}{c^6 (i+x)^5}-\frac {i a B}{c^6 (i+x)^4}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {2 a^2 (A-i B)}{5 c^5 f (i+\tan (e+f x))^5}+\frac {a^2 (i A+3 B)}{4 c^5 f (i+\tan (e+f x))^4}+\frac {i a^2 B}{3 c^5 f (i+\tan (e+f x))^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.41, size = 116, normalized size = 1.22 \begin {gather*} \frac {a^2 (5 (-21 i A+B) \cos (e+f x)+6 (-7 i A+3 B) \cos (3 (e+f x))-(3 A+7 i B) (5 \sin (e+f x)+6 \sin (3 (e+f x)))) (\cos (7 e+9 f x)+i \sin (7 e+9 f x))}{960 c^5 f (\cos (f x)+i \sin (f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.44, size = 69, normalized size = 0.73
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {-i A -3 B}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {2 i B -2 A}{5 \left (i+\tan \left (f x +e \right )\right )^{5}}+\frac {i B}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}\right )}{f \,c^{5}}\) | \(69\) |
default | \(\frac {a^{2} \left (-\frac {-i A -3 B}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {2 i B -2 A}{5 \left (i+\tan \left (f x +e \right )\right )^{5}}+\frac {i B}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}\right )}{f \,c^{5}}\) | \(69\) |
risch | \(-\frac {a^{2} {\mathrm e}^{10 i \left (f x +e \right )} B}{80 c^{5} f}-\frac {i a^{2} {\mathrm e}^{10 i \left (f x +e \right )} A}{80 c^{5} f}-\frac {{\mathrm e}^{8 i \left (f x +e \right )} B \,a^{2}}{64 c^{5} f}-\frac {3 i {\mathrm e}^{8 i \left (f x +e \right )} a^{2} A}{64 c^{5} f}+\frac {{\mathrm e}^{6 i \left (f x +e \right )} B \,a^{2}}{48 c^{5} f}-\frac {i {\mathrm e}^{6 i \left (f x +e \right )} a^{2} A}{16 c^{5} f}+\frac {a^{2} {\mathrm e}^{4 i \left (f x +e \right )} B}{32 c^{5} f}-\frac {i a^{2} {\mathrm e}^{4 i \left (f x +e \right )} A}{32 c^{5} f}\) | \(174\) |
norman | \(\frac {\frac {a^{2} A \tan \left (f x +e \right )}{c f}+\frac {-9 i A \,a^{2}+a^{2} B}{60 c f}-\frac {\left (-7 i B \,a^{2}+12 a^{2} A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 c f}+\frac {\left (i A \,a^{2}+7 a^{2} B \right ) \left (\tan ^{6}\left (f x +e \right )\right )}{4 c f}+\frac {7 \left (-8 i B \,a^{2}+3 a^{2} A \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{15 c f}+\frac {\left (33 i A \,a^{2}+7 a^{2} B \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{12 c f}-\frac {\left (39 i A \,a^{2}+49 a^{2} B \right ) \left (\tan ^{4}\left (f x +e \right )\right )}{12 c f}+\frac {i B \,a^{2} \left (\tan ^{7}\left (f x +e \right )\right )}{3 c f}}{\left (1+\tan ^{2}\left (f x +e \right )\right )^{5} c^{4}}\) | \(227\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.94, size = 93, normalized size = 0.98 \begin {gather*} -\frac {12 \, {\left (i \, A + B\right )} a^{2} e^{\left (10 i \, f x + 10 i \, e\right )} + 15 \, {\left (3 i \, A + B\right )} a^{2} e^{\left (8 i \, f x + 8 i \, e\right )} + 20 \, {\left (3 i \, A - B\right )} a^{2} e^{\left (6 i \, f x + 6 i \, e\right )} + 30 \, {\left (i \, A - B\right )} a^{2} e^{\left (4 i \, f x + 4 i \, e\right )}}{960 \, c^{5} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 332 vs. \(2 (76) = 152\).
time = 0.46, size = 332, normalized size = 3.49 \begin {gather*} \begin {cases} \frac {\left (- 245760 i A a^{2} c^{15} f^{3} e^{4 i e} + 245760 B a^{2} c^{15} f^{3} e^{4 i e}\right ) e^{4 i f x} + \left (- 491520 i A a^{2} c^{15} f^{3} e^{6 i e} + 163840 B a^{2} c^{15} f^{3} e^{6 i e}\right ) e^{6 i f x} + \left (- 368640 i A a^{2} c^{15} f^{3} e^{8 i e} - 122880 B a^{2} c^{15} f^{3} e^{8 i e}\right ) e^{8 i f x} + \left (- 98304 i A a^{2} c^{15} f^{3} e^{10 i e} - 98304 B a^{2} c^{15} f^{3} e^{10 i e}\right ) e^{10 i f x}}{7864320 c^{20} f^{4}} & \text {for}\: c^{20} f^{4} \neq 0 \\\frac {x \left (A a^{2} e^{10 i e} + 3 A a^{2} e^{8 i e} + 3 A a^{2} e^{6 i e} + A a^{2} e^{4 i e} - i B a^{2} e^{10 i e} - i B a^{2} e^{8 i e} + i B a^{2} e^{6 i e} + i B a^{2} e^{4 i e}\right )}{8 c^{5}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 309 vs. \(2 (80) = 160\).
time = 1.25, size = 309, normalized size = 3.25 \begin {gather*} -\frac {2 \, {\left (15 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{9} + 45 i \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{8} - 15 \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{8} - 150 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 10 i \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} - 225 i \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 55 \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 306 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 24 i \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 225 i \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 55 \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 150 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 10 i \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 45 i \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 15 \, B a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 15 \, A a^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{15 \, c^{5} f {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{10}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.77, size = 108, normalized size = 1.14 \begin {gather*} \frac {\frac {a^2\,\left (9\,A+B\,1{}\mathrm {i}\right )}{60}+\frac {a^2\,\mathrm {tan}\left (e+f\,x\right )\,\left (5\,B+A\,15{}\mathrm {i}\right )}{60}+\frac {B\,a^2\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{3}}{c^5\,f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^5+{\mathrm {tan}\left (e+f\,x\right )}^4\,5{}\mathrm {i}-10\,{\mathrm {tan}\left (e+f\,x\right )}^3-{\mathrm {tan}\left (e+f\,x\right )}^2\,10{}\mathrm {i}+5\,\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________